package handlers

import (
	"MBTIx/dba"
	"MBTIx/models"
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/jmoiron/sqlx"
)

func Get_mold(c *gin.Context) {
	db, _ := c.Get("db")

	var molds []models.Mold
	dba.GetAllMold(db.(*sqlx.DB), &molds)
	c.JSON(http.StatusOK, gin.H{
		"code": 0,
		"data": gin.H{
			"molds": molds,
		},
	})
}
